<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>jQuery File Tree Demo</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		
		<style type="text/css">
			BODY,
			HTML {
				padding: 0px;
				margin: 0px;
			}
			BODY {
				font-family: Verdana, Arial, Helvetica, sans-serif;
				font-size: 11px;
				background: #EEE;
				padding: 15px;
			}
			
			H1 {
				font-family: Georgia, serif;
				font-size: 20px;
				font-weight: normal;
			}
			
			H2 {
				font-family: Georgia, serif;
				font-size: 16px;
				font-weight: normal;
				margin: 0px 0px 10px 0px;
			}
			
			.example {
				float: left;
				margin: 15px;
			}
			
			.demo {
				float: left;
				width: 200px;
				height: 200px;
				overflow: scroll;
				border-top: solid 1px #BBB;
				border-left: solid 1px #BBB;
				border-bottom: solid 1px #FFF;
				border-right: solid 1px #FFF;
				background: #FFF;
				padding: 5px;
				z-index: 1;
			}

			.demoleft{
			clear: both;
				float: left;
			}
			P.note {
				color: #999;
				clear: both;
			}
		</style>
		
		<script src="jquery.js" type="text/javascript"></script>

		<script src="jquery.easing.js" type="text/javascript"></script>
		<script src="jqueryFileTree.js" type="text/javascript"></script>
		<link href="jqueryFileTree.css" rel="stylesheet" type="text/css" media="screen" />
		  <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
		  <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.draggable.js"></script>
		  <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.droppable.js"></script>
		<script type="text/javascript">
			
			$(document).ready( function() {
				
				$('#file_list').fileTree({ root: '', script: 'jqueryFileTree.php', folderEvent: 'dblclick', expandSpeed: 750, collapseSpeed: 750 }, function(file) { 
					alert(file);
				}, function(){
				$('.directory').draggable({				
   start: function(event, ui) {$("#file_list").css("overflow","visible"); },
   stop: function(event, ui) { $("#file_list").css("overflow","auto");
    }

});
//				
				$('.directory').draggable('option', 'revert', true);
				
				});
				$("#added_list").droppable({
				      drop: function(event,ui) { alert('dropped --- '+ui.draggable.children().attr('rel')); }

			    });
				
			});

		</script>

	</head>
	
	<body>		
	<div style="overflow:hidden; border: 1px solid red;">
		<div  class="demo" id="file_list">

		</div>
		<div  class="demo" id="added_list">

		</div>

	</div>

	</body>
	
</html>